# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Michal Krenek <mikos@sg1.cz>

pkgname=ttf-dejavu
_commit=9b5d1b2ffeec20c7b46aa89c0223d783c02762cf # master
pkgver=2.37+18+g9b5d1b2f
pkgrel=4
pkgdesc='Font family based on the Bitstream Vera Fonts with a wider range of characters'
arch=(any)
url='https://dejavu-fonts.github.io'
license=(custom)
makedepends=(git fontforge perl-font-ttf)
provides=(ttf-font)
source=("git+https://github.com/dejavu-fonts/dejavu-fonts.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
	cd dejavu-fonts
	git describe --tags | sed 's/^version_//;s/_/./;s/-/+/g'
}

build() {
	cd dejavu-fonts
	make full-ttf
}

package() {
	cd dejavu-fonts
	install -Dm0644 -t "$pkgdir/usr/share/fonts/TTF" build/*.ttf
	install -Dm0644 -t "$pkgdir/usr/share/fontconfig/conf.avail" fontconfig/*.conf
	mkdir -p "$pkgdir/usr/share/fontconfig/conf.default"
	ln -srt "$pkgdir/usr/share/fontconfig/conf.default" \
		"$pkgdir"/usr/share/fontconfig/conf.avail/*
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
